package com.pf.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.pf.business.mapper.UserMapper;
import com.pf.business.mapper.entity.User;
import com.pf.business.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2021/8/7
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUser(Integer userId) {
        log.info(">>>>> getUser 从数据库中获取...");
        return userMapper.selectOne(new LambdaQueryWrapper<User>()
                .eq(User::getUserId, userId)
        );
    }
}
